#define _CRT_SECURE_NO_WARNINGS


#include"list.h"


void test1()
{
	SLNode* plist = NULL;
	SListInit(&plist);
	SListInsert(plist->next, 1);
	SListInsert(plist->next, 2);
	SListInsert(plist->next, 3);
	SListInsert(plist->next, 4);
	SlistPrint(plist);
	
	SLNode* node1 = SListFind(plist, 2);

	SListInsert(node1, 5);
	SListInsert(node1, 6);
	SListInsert(node1, 7);


	SlistPrint(plist);

	SListErase(plist->next);
	SListErase(plist->next);
	SListErase(plist->next);
	SListErase(plist->next);
	SListErase(plist->next);
	SListErase(plist->next);
	SListErase(plist->next);
	SlistPrint(plist);


	Slistdestroy(&plist);
}

void test2()
{
	SLNode* plist = NULL;
	SListInit(&plist);

	SListPushFront(plist, 1);
	SListPushFront(plist, 2);
	SListPushFront(plist, 3);
	SListPushFront(plist, 4);

	SlistPrint(plist);

	SListPushBack(plist, 1);
	SlistPrint(plist);

	SListPushBack(plist, 2);
	
	SlistPrint(plist);
	SListPushBack(plist, 3);
	
	SlistPrint(plist);
	SListPushBack(plist, 4);

	SlistPrint(plist);
	SlistPopFront(plist);
	SlistPopFront(plist);
	SlistPopFront(plist);
	SlistPrint(plist);
	SlistPopBack(plist);
	SlistPopBack(plist);
	SlistPopBack(plist);

	SlistPrint(plist);


	Slistdestroy(&plist);
}
int main()
{
	test2();

	return 0;
}